package com.sg.controller.bff;

import com.sg.service.biz.bff.QuestionService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Question", tags = {"Question"})
@RestController
// @RequestMapping("/oms/question/")
public class QuestionController {

    @Autowired
    QuestionService questionService;

    /**
     * B3查询问题详情
     * gen by moon at 11/8/2023, 4:07:27 PM
     */
    @PostMapping("/oms/question/queryQuestionDetail")
    @ApiOperation(value = "B3查询问题详情", response = OkrResult.class)
    public OkrResult<BffQueryQuestionDetailRespDto> queryQuestionDetail(@RequestBody(required = false) @Validated BffQueryQuestionDetailReqDto reqDTO) {
        return OkrResult.success(questionService.queryQuestionDetail(reqDTO));
    }

    /**
     * B3修改问题
     * gen by moon at 11/8/2023, 4:24:19 PM
     */
    @PostMapping("/oms/question/updateQuestion")
    @ApiOperation(value = "B3修改问题", response = OkrResult.class)
    public OkrResult<BffUpdateQuestionRespDto> updateQuestion(@RequestBody(required = false) @Validated BffUpdateQuestionReqDto reqDTO) {
        return OkrResult.success(questionService.updateQuestion(reqDTO));
    }

    /**
     * B3查问题列表
     * gen by moon at 11/8/2023, 4:24:22 PM
     */
    @PostMapping("/oms/question/queryQuestionList")
    @ApiOperation(value = "B3查问题列表", response = OkrResult.class)
    public OkrResult<BffQueryQuestionListRespDto> queryQuestionList(@RequestBody(required = false) @Validated BffQueryQuestionListReqDto reqDTO) {
        return OkrResult.success(questionService.queryQuestionList(reqDTO));
    }

    /**
     * B3删除问题
     * gen by moon at 11/8/2023, 4:24:35 PM
     */
    @PostMapping("/oms/question/deleteQuestion")
    @ApiOperation(value = "B3删除问题", response = OkrResult.class)
    public OkrResult<BffDeleteQuestionRespDto> deleteQuestion(@RequestBody(required = false) @Validated BffDeleteQuestionReqDto reqDTO) {
        return OkrResult.success(questionService.deleteQuestion(reqDTO));
    }

    /**
     * B3存档问题
     * gen by moon at 11/8/2023, 4:24:38 PM
     */
    @PostMapping("/oms/question/archiveQuestion")
    @ApiOperation(value = "B3存档问题", response = OkrResult.class)
    public OkrResult<BffArchiveQuestionRespDto> archiveQuestion(@RequestBody(required = false) @Validated BffArchiveQuestionReqDto reqDTO) {
        return OkrResult.success(questionService.archiveQuestion(reqDTO));
    }

    /**
     * B3新增问题
     * gen by moon at 11/10/2023, 3:57:39 PM
     */
    @PostMapping("/oms/question/addQuestion")
    @ApiOperation(value = "B3新增问题", response = OkrResult.class)
    public OkrResult<BffAddQuestionRespDto> addQuestion(@RequestBody(required = false) @Validated BffAddQuestionReqDto reqDTO) {
        return OkrResult.success(questionService.addQuestion(reqDTO));
    }

    /**
     * B3设问题挂起
     * gen by moon at 11/11/2023, 2:16:52 AM
     */
    @PostMapping("/oms/question/setQuestionHangUp")
    @ApiOperation(value = "B3设问题挂起", response = OkrResult.class)
    public OkrResult<BffSetQuestionHangUpRespDto> setQuestionHangUp(@RequestBody(required = false) @Validated BffSetQuestionHangUpReqDto reqDTO) {
        return OkrResult.success(questionService.setQuestionHangUp(reqDTO));
    }

    /**
     * B3设问题拒绝
     * gen by moon at 11/11/2023, 2:16:59 AM
     */
    @PostMapping("/oms/question/setQuestionTurnDown")
    @ApiOperation(value = "B3设问题拒绝", response = OkrResult.class)
    public OkrResult<BffSetQuestionTurnDownRespDto> setQuestionTurnDown(@RequestBody(required = false) @Validated BffSetQuestionTurnDownReqDto reqDTO) {
        return OkrResult.success(questionService.setQuestionTurnDown(reqDTO));
    }
}
